<?php 
if (!isset($_GET['id'])) header('location:/'); else header('location:/');
include('libary/init_index.php');
$cmd="SELECT * FROM `media` WHERE media_md5='".$_GET['id']."'"; 
$info=mysql_fetch_assoc(mysql_query($cmd));
if (substr($info['media_link'],strlen($info['media_link'])-3,3)=='mp3') $link='http://cailuongso.com/data/';
$filepath=$link.$info['media_link']; 
$ext=substr($info['media_link'],strlen($info['media_link'])-4,4);
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=".isolink($info['media_name']).$ext);
header("Content-Type: mime/type");
header("Content-Transfer-Encoding: binary");  
header('Content-Length: '. filesize($filepath));
readfile($filepath);  
?>